#include <stdio.h>
long long factorial(int n) {
    if (n == 0)
        return 1;
    else
        return n * factorial(n - 1);
}
int main() {
    int number;
    printf("请输入一个正整数: ");
    scanf("%d", &number);
    if (number < 0)
        printf("错误：负数没有阶乘！\n");
    else
        printf("阶乘为: %lld\n", factorial(number));
    return 0;
}
